const { getProjects } = require('../models/api')

exports.home = async (ctx, next) => {
  let projects = await getProjects()
  let list = []
  projects.forEach(item => {
    list.push({
      key: item.key,
      title: item.title
    })
  })
  await ctx.render('home', { list })
}